# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=fpdns
pkgver=109.655bfa7
pkgrel=2
epoch=2
pkgdesc='Program that remotely determines DNS server versions.'
groups=('blackarch' 'blackarch-fingerprint')
url='https://github.com/kirei/fpdns'
depends=('perl' 'perl-net-dns')
makedepends=('git')
license=('BSD')
options=('!emptydirs')
arch=('any')
source=("git+https://github.com/kirei/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  /usr/bin/perl Makefile.PL INSTALLDIRS=vendor
  /usr/bin/make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  mv "$pkgdir/usr/bin/vendor_perl/$pkgname" "$pkgdir/usr/bin/"
  rmdir "$pkgdir/usr/bin/vendor_perl/"
}

